package com.cn.web.app.order.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.cn.web.app.order.entity.OrderInfoEntity;
import com.cn.web.app.order.vo.OrderInfoListVO;
import com.cn.web.app.order.vo.OrderInfoSearch;
import com.cn.web.app.template.vo.OrderTemplateSearch;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * description: IOrderInfoMapper <br>
 * date: 24.7.12 11:56 <br>
 * author: cn_yaojin <br>
 * version: 1.0 <br>
 */
@Mapper
public interface IOrderInfoMapper extends BaseMapper<OrderInfoEntity> {

    @Select("select o1.*,u1.user_name,u2.org_name,o2.template_name  from order_info o1,sys_user u1,sys_unit u2 ,order_template o2 " +
                "where o1.user_id=u1.id and o1.org_id=u2.id  and o1.template_id=o2.id " +
            "and ${ew.sqlSegment}")
    List<OrderInfoListVO> list(@Param(value = "ew") QueryWrapper<OrderInfoSearch> ew);

}
